<template>
	<view class="content">
		<view class="navtab">

			<view class="navtabs">
				<view class="icons">
					<view class="imgss">
						<image src="../../static/联系人.png" mode="" class="imgs"></image>
					</view>

					<view class="title" @click="onddd()">
						{{title}}
					</view>
					<view class="iconss">
						<uni-icons type="right" size="20" color="#ccc"></uni-icons>
					</view>
				</view>
				<view class="icons">
					<view class="imgss">
						<image src="../../static/订单.png" mode="" class="imgs"></image>
					</view>

					<view class="title" @click="onddffr()">
						{{title1}}
					</view>
					<view class="iconss">
						<uni-icons type="right" size="20" color="#ccc"></uni-icons>
					</view>
				</view>
				<view class="icon-del-box">
					<view class="imgss">
						<image src="../../static/个人中心 客服.png" mode="" class="imgs"></image>
					</view>

					<view class="title" @click="onfjjd()">
						{{title2}}
					</view>
					<view class="iconss">
						<uni-icons type="right" size="20" color="#ccc"></uni-icons>
					</view>
				</view>
				<view>

				</view>
			</view>
		</view>
		<view class="icon-add" v-if="show == false">
			<view class="icon-calendar">
				<u-avatar size="70" fontSize="18" randomBgColor></u-avatar>
			</view>

			<button class="button-hock" @click="onlogin()">{{titlelogin}}</button>

		</view>

		<view class="icon-login" v-if="show == true">
			<view class="left">
				<u-avatar :src="imgs" size="40" fontSize="12" randomBgColor></u-avatar>
				<uni-title :title="titlelogin" color="white" width="60px"></uni-title>
			</view>

			<view class="right">
				<button
					style="font-size: 13px; width: 200px; height: 30px; border:none; color:white; border-color: #00ACBD; background-color: #00ACBD;"
					@click="onlogin()">切换账号</button>
				<uni-icons type="right" size="20" color="#fff"></uni-icons>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				title: "常用联系人",
				title1: "我的订单",
				title2: "客服中心",
				titlelogin: '登录/注册',
				imgs: ""
			}
		},
		onLoad() {
			let _this = this
			let username = uni.getStorageSync('username')
			if (username) {
				let img = uni.getStorageSync('img')
				_this.titlelogin = username
				_this.imgs = img
				_this.show = true
			} else {
				_this.titlelogin = '登录/注册'
			}
		},
		onShow() {
			let _this = this
			let username = uni.getStorageSync('username')
			if (username) {
				let img = uni.getStorageSync('img')
				_this.titlelogin = username
				_this.imgs = img
				_this.show = true
			} else {
				_this.titlelogin = '登录/注册'
			}
		},
		methods: {
			onlogin() {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			},
			onddd() {
				uni.navigateTo({
					url: "/pages/XinZen/XinZen"
				})
			},
			onfjjd() {
				uni.switchTab({
					url: "/pages/customerService/customerService"
				})
			},
			onddffr() {
				uni.switchTab({
					url: "/pages/order/order"
				})
			}
		}
	}
</script>

<style lang="scss">
	.navtab {
		width: 100%;
		height: 700rpx;
		/* 	background-color: #00ACBD; 
		border-radius: 0 0 95% 95%; */
		position: relative;
		/* z-index: -1; */
	}

	.navtab:after {
		width: 140%;
		height: 700rpx;
		position: absolute;
		left: -20%;
		top: 0;
		z-index: -1;
		content: '';
		border-radius: 0 0 50% 50%;
		background-color: #00ACBD;
	}

	.navtabs {
		width: 700rpx;
		height: 400rpx;
		background-color: #fff;
		position: absolute;
		left: 27rpx;
		top: 400rpx;
		border-radius: 30rpx;
		border: 1px solid #ccc;
	}

	.content {
		// width: 100%;
		// height: 1625rpx;
		// background-color: #ccc;
		// overflow: hidden;

	}

	.icons {
		width: 90%;
		height: 120rpx;
		border-bottom: 2rpx solid #ccc;
		margin-left: 33rpx;
		margin-top: 10rpx;
	}

	.icondvvsc {
		width: 352px;
		height: 65px;

	}

	.icon-del-box {
		width: 90%;
		height: 120rpx;
		margin-left: 33rpx;
		margin-top: 10rpx;
	}

	.imgs {
		width: 90rpx;
		height: 90rpx;
		line-height: 90rpx;
	}

	.title {
		width: 200rpx;
		height: 100rpx;
		line-height: 100rpx;
		float: left;
		margin-left: 20rpx;
		display: inline-block;
		font-size: 37rpx;

	}

	.imgss {
		width: 100rpx;
		height: 100rpx;
		line-height: 100rpx;
		display: inline-block;
		float: left;
	}

	.iconss {
		width: 90rpx;
		height: 90rpx;
		line-height: 90rpx;
		float: left;
		margin-left: 200rpx;
		text-align: center;
	}

	.icon-add {
		width: 300rpx;
		height: 270rpx;
		position: absolute;
		top: 100rpx;
		left: 230rpx;
	}

	.icon-calendar {
		width: 50%;
		height: 150rpx;
		margin-left: 80rpx;
	}

	.button-hock {
		background-color: #00ACBD;
		border: none;
		color: #fff;
	}

	.obogof {
		margin-top: -300px;
	}

	.icon-login {
		width: 350px;
		height: 60px;
		margin-top: -300px;
		margin-left: 15px;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.left {
			width: 100px;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.right {
			width: 120px;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}
	}
</style>